import prettytable as pt
#显示座位
def show_ticket(row_num):
    tb=pt.PrettyTable()
    tb.field_names=['行号','座位1','座位2','座位3','座位4','座位5']
    for i in range(row_num):
        lst=[f'第{i+1}行','有票','有票','有票','有票','有票']
        tb.add_row(lst)
    print(tb)
def order_ticket(row_num,row,column):
    tb = pt.PrettyTable()
    for i in range(row_num):
        if(int(row)==(i+1)):
            lst=[f'第{i+1}行','有票','有票','有票','有票','有票']
            lst[int(column)]='已售'
            tb.add_row(lst)
        else:
            lst = [f'第{i + 1}行', '有票', '有票', '有票', '有票', '有票']
            tb.add_row(lst)
    print(tb)

if __name__ == '__main__':
    row_num=13
    show_ticket(row_num)
    try:
        row,column=input('请输入座位号如3,5:').split(',')
    except:
        print('输入有误,请重新运行')
    else:
        order_ticket(row_num,row,column)






